#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>

char* find_max(char(*arr)[80], int k)
{
	char* p = arr;
	int i = 0;
	for (i = 1 ;i < k; i++)
	{
		if (strcmp(p, arr + i) < 0)
			p = arr + i;
	}
	return p;
}

int main()
{
	int n = 0;
	scanf("%d", &n);
	char str[100][80] = { 0 };
	int i = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%s", str[i]);
	}
	char * max = NULL;
	max = find_max(str, n);
	puts(max);
	return 0;
}